package cn.sccdlg.ssm.service.impl;

import cn.sccdlg.ssm.dao.ISysLogDao;
import cn.sccdlg.ssm.domain.SysLog;
import cn.sccdlg.ssm.service.SysLogService;
import cn.sccdlg.ssm.utils.UuidUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author RaoShuang
 * @emil 991207823@qq.com
 * @date 2020/10/28 22:23
 * 系统操作日志业务层实现类
 */
@Service("sysLogService")
@Transactional(rollbackFor = {Exception.class, Error.class})
public class SysLogServiceImpl implements SysLogService {

    @Autowired
    private ISysLogDao sysLogDao;

    @Override
    public List<SysLog> findAll() throws Exception {
        return sysLogDao.findAll();
    }

    @Override
    public void save(SysLog sysLog) throws Exception {
        sysLog.setId(UuidUtils.getUnid());
        sysLogDao.save(sysLog);
    }
}
